<template>
  <div class="a" v-if="isShow">
    <div class="wp">
      <h1>sorry闯关超时</h1>
      <p>请按“返回”键，重新开始本关游戏</p>
      <!-- <button @click="reload">返回</button> -->
      <button @click="asyncReload">返回</button>
    </div>
  </div>
</template>

<script>
import { mapActions } from "vuex";
export default {
  props: {
    isShow: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    ...mapActions(["asyncReload"]),
    // reload() {
    //   location.reload();
    // }
  }
  //   mounted(){
  //       console.log(this);
  //   }
};
</script>

<style scoped>
.a {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 999;
}
.wp {
  height: 147px;
  background-color: #fff;
  margin: 138px 16px 0;
  border-radius: 10px;
  padding: 20px 25px;
}
.wp h1 {
  font-size: 24px;
  font-weight: normal;
  color: #333;
  background-image: url(../assets/sad.png);
  background-repeat: no-repeat;
  background-size: 31px;
  text-indent: 38px;
  text-align: center;
  background-position: 23px center;
}
.wp p {
  font-size: 18px;
  color: #333;
  margin-top: 20px;
}
.wp button {
  border: none;
  width: 100px;
  height: 40px;
  background-color: #e66f13;
  color: #fff;
  font-size: 24px;
  border-radius: 10px;
  display: block;
  margin: 10px auto 0;
  outline: none;
}
</style>
